package com.dianqiu.common.bean;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import com.dianqiu.base.bean.BaseTO;

/**
 * DqHandicap entity. @author David Dai
 */
@Entity
@Table(name = "dq_handicap", catalog = "dq_dev")
public class DqHandicapTO extends BaseTO implements  java.io.Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer hdpId;
	private DqHandicapTypeTO dqHandicapType;
	private DqBetCompanyTO dqBetCompany;
	private DqMatchTO dqMatch;
	private Double homeClbRate;
	private Double awayClbRate;
	private String userId;
	private Set<DqBetUserMatchTO> dqBetUserMatchs = new HashSet<DqBetUserMatchTO>(0);

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "HDP_ID", unique = true, nullable = false)
	public Integer getHdpId() {
		return this.hdpId;
	}

	public void setHdpId(Integer hdpId) {
		this.hdpId = hdpId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "HDP_TYPE_ID", nullable = false)
	public DqHandicapTypeTO getDqHandicapType() {
		return this.dqHandicapType;
	}

	public void setDqHandicapType(DqHandicapTypeTO dqHandicapType) {
		this.dqHandicapType = dqHandicapType;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "BET_COMP_ID", nullable = false)
	public DqBetCompanyTO getDqBetCompany() {
		return this.dqBetCompany;
	}

	public void setDqBetCompany(DqBetCompanyTO dqBetCompany) {
		this.dqBetCompany = dqBetCompany;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MTH_ID", nullable = false)
	public DqMatchTO getDqMatch() {
		return this.dqMatch;
	}

	public void setDqMatch(DqMatchTO dqMatch) {
		this.dqMatch = dqMatch;
	}

	@Column(name = "HOME_CLB_RATE", precision = 22, scale = 0)
	public Double getHomeClbRate() {
		return this.homeClbRate;
	}

	public void setHomeClbRate(Double homeClbRate) {
		this.homeClbRate = homeClbRate;
	}

	@Column(name = "AWAY_CLB_RATE", precision = 22, scale = 0)
	public Double getAwayClbRate() {
		return this.awayClbRate;
	}

	public void setAwayClbRate(Double awayClbRate) {
		this.awayClbRate = awayClbRate;
	}

	@Column(name = "USER_ID", length = 13)
	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dqHandicap")
	public Set<DqBetUserMatchTO> getDqBetUserMatchs() {
		return this.dqBetUserMatchs;
	}

	public void setDqBetUserMatchs(Set<DqBetUserMatchTO> dqBetUserMatchs) {
		this.dqBetUserMatchs = dqBetUserMatchs;
	}

}